package jp.sourceforge.akjrcp.flvtools.basic;

import jp.sourceforge.akjrcp.akj_betas.Akj_betasPlugin;
import jp.sourceforge.akjrcp.akj_betas.Messages;
import jp.sourceforge.akjrcp.ffmpeg.FFMpegOptions;

import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

public class MPEGSettingPage extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
	public static final String MPEG_VIDEO_CODEC="mpegsetting.video";
	public static final String MPEG_AUDIO_CODEC="mpegsetting.audio";
	
	public static final String MPEG_TYPE = "mpegsetting.mpeg_type";
	public static final String MPEG_TYPE_CBR = "mpeg_type_cbr";
	public static final String MPEG_TYPE_VBR = "mpeg_type_vbr";
	
	public MPEGSettingPage() {
		super(GRID);
		setPreferenceStore(Akj_betasPlugin.getDefault().getPreferenceStore());
		setDescription(Messages.getString("mpegsetting.description")); //$NON-NLS-1$
		initializeDefaults();
	}
	
	private void initializeDefaults() {
		
		// no one call it before open them

	}

	protected void createFieldEditors() {
		
        addField(new RadioGroupFieldEditor(
        		MPEG_VIDEO_CODEC,
				Messages.getString("wmvsetting.video"), // //$NON-NLS-1$
				2,
				new String[][] { 
				{ Messages.getString("mpegsetting.mpeg1"), FFMpegOptions.CODEC_VIDEO_MPEG1 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("mpegsetting.mpeg2"), FFMpegOptions.CODEC_VIDEO_MPEG2 }, //$NON-NLS-1$ //$NON-NLS-2$
			
				
			}, getFieldEditorParent()));
        
        addField(new RadioGroupFieldEditor(
        		MPEG_AUDIO_CODEC,
				Messages.getString("wmvsetting.audio"), // //$NON-NLS-1$
				2,
				new String[][] { 
				{ Messages.getString("mpegsetting.mp2"), FFMpegOptions.CODEC_AUDIO_MP2 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("mpegsetting.ac3"), FFMpegOptions.CODEC_AUDIO_AC3 }, //$NON-NLS-1$ //$NON-NLS-2$
				
				
				
			}, getFieldEditorParent()));
        
        addField(new RadioGroupFieldEditor(
		        MPEG_TYPE,
				Messages.getString("mpeg_type"), // //$NON-NLS-1$
				2,
				new String[][] { {"VBR",MPEG_TYPE_VBR},{"CBR",MPEG_TYPE_CBR}},getFieldEditorParent()));
        
	}

	public void init(IWorkbench workbench) {
		// TODO Auto-generated method stub
		
	}

}
